package io;

import java.io.*;

/**
 * Created by Administrator on 2017/12/21.
 */
public class InputStreamReaderTest {


    public static void main(String[] args) throws IOException {
        File file = new File("D:/out2.txt");
        InputStreamReader in =  new InputStreamReader(System.in);
        OutputStream out = null;
        try {
            out =new BufferedOutputStream( new FileOutputStream(file));
        int len =0;
        while ((len=in.read())!=-1){
            out.write(len);
            System.out.println(len);
        }
        
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally{
        out.close();
        in.close();
        }
    }

}
